package com.dayu.recovery.domain;

import java.math.BigDecimal;

import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.dayu.common.annotation.Excel;
import com.dayu.common.core.domain.BaseEntity;

/**
 * 配件管理对象 recovery_parts
 * 
 * @author HK
 * @date 2021-04-16
 */
public class RecoveryParts extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 配件编号 */
    private Long partsId;

    /** 配件名称 */
    @Excel(name = "配件名称")
    private String partsName;

    /** 配件价格 */
    @Excel(name = "配件价格")
    private BigDecimal partsPrice;

    @Excel(name = "配件数量")
    private Integer partsNo;

    @Excel(name = "总金额")
    private BigDecimal totalPrice;

    /** 状态 */
    @Excel(name = "状态")
    private Integer status;

    /* 构建合计金额*/
    public void builderTotalPrice() {
        if(ObjectUtils.isEmpty(partsPrice)) {
            return;
        }
        if(ObjectUtils.isEmpty(partsNo)) {
            return;
        }
        totalPrice = partsPrice.multiply(new BigDecimal(partsNo));
    }

    public Integer getPartsNo() {
        return partsNo;
    }

    public void setPartsNo(Integer partsNo) {
        this.partsNo = partsNo;
    }

    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    public void setPartsId(Long partsId)
    {
        this.partsId = partsId;
    }

    public Long getPartsId() 
    {
        return partsId;
    }
    public void setPartsName(String partsName) 
    {
        this.partsName = partsName;
    }

    public String getPartsName() 
    {
        return partsName;
    }
    public void setPartsPrice(BigDecimal partsPrice) 
    {
        this.partsPrice = partsPrice;
    }

    public BigDecimal getPartsPrice() 
    {
        return partsPrice;
    }
    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("partsId", getPartsId())
            .append("partsName", getPartsName())
            .append("partsPrice", getPartsPrice())
            .append("status", getStatus())
            .toString();
    }
}
